//
//  PFileController.swift
//  CJPack
//
//  Created by 陈警卫 on 2023-08-25.
//

import UIKit

class PFileController: CJBaseBackController {

    override func viewDidLoad() {
        super.viewDidLoad()
        
        setupView()
    }
    
    func setupView() {
        
        let btn = UIButton(type: .custom)
        btn.setTitle("创建文件", for: .normal)
        btn.setTitleColor(.black, for: .normal)
        btn.frame = CGRect(x: 20, y: 100, width: 0, height: 0)
        view.addSubview(btn)
        btn.sizeToFit()
        btn.cj_addAction { [weak self] btn in
            self?.createFile()
        }
    }
    
    func createFile() {
        let cache = CJFile.cachesPath
        let path = cache + "/cjpack" + "/test.txt"
        let comp = CJFile.createFile(path)
        kCJLog(comp)
    }
   

}

